package com.itheima.iostream;

import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;

public class FileWriter01 {
    public static void main(String[] args){
        FileWriter fileWriter = null;
        try{
            fileWriter =new FileWriter("src\\com\\itheima\\iostream\\myfile2");

            char[] writeBytes = {'q','w','e','r'};

            fileWriter.write(writeBytes);
            fileWriter.write("直接写");

            fileWriter.flush();

        }catch(FileNotFoundException e){
            e.printStackTrace();
        }catch(IOException e){
            e.printStackTrace();
        }finally{
            if(fileWriter!=null){
                try {
                    fileWriter.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }



    }
}
